//
//  TSBugInLisHomeViewController.m
//  CJUIKitDemo
//
//  Created by ciyouzen on 2017/2/25.
//  Copyright © 2017年 dvlproad. All rights reserved.
//

#import "TSBugInLisHomeViewController.h"

#import "TSBugTapOnScrollViewController.h"
#import "TSBugTapOnTextViewController.h"

#import "TSBugTapOnCellDidSelectViewController.h"
#import "TSBugDidSelectOnButtonViewController.h"


#import "TSBugTapSameViewController.h"

#import "TSBugReuseTableViewController1.h"
#import "TSBugReuseTableViewController2.h"

#import "TSBugReloadCollectionViewController.h"

@interface TSBugInLisHomeViewController () {
    
}

@end

@implementation TSBugInLisHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = NSLocalizedString(@"TestBug首页", nil);
    

    NSMutableArray *sectionDataModels = [[NSMutableArray alloc] init];
    
    // DidSelect无响应的Bug
    {
        // 知识点：didSelect的事件会被列表所在视图上的自定义tapGesture拦截，导致无响应；但不会被被列表所在视图上的button点击事件拦截
        CQDMSectionDataModel *sectionDataModel = [[CQDMSectionDataModel alloc] init];
        sectionDataModel.theme = @"测试 DidSelect无响应的Bug 等";
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"didSelect被自定义tapGesture拦截";
            module.content = @"修复didSelect被列表所在视图上的自定义tapGesture拦截";
            module.classEntry = [TSBugTapOnCellDidSelectViewController class];
            [sectionDataModel.values addObject:module];
        }
        
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"ScrollView添加tapGesture";
            module.content = @"修复View上的UIScrollView阻断了UITouch事件传递";
            module.classEntry = [TSBugTapOnScrollViewController class];
            [sectionDataModel.values addObject:module];
        }
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"textView添加tapGesture";
            module.content = @"修复textView添加tapGesture";
            module.classEntry = [TSBugTapOnTextViewController class];
            [sectionDataModel.values addObject:module];
        }
        
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"didSelect不会被被列表所在视图上的button点击事件拦截";
            module.content = @"didSelect不会被被列表所在视图上的button点击事件拦截";
            module.classEntry = [TSBugDidSelectOnButtonViewController class];
            [sectionDataModel.values addObject:module];
        }
        [sectionDataModels addObject:sectionDataModel];
    }
    
    // 同一个view上添加两个相同的手势
    {
        CQDMSectionDataModel *sectionDataModel = [[CQDMSectionDataModel alloc] init];
        sectionDataModel.theme = @"同一个view上添加两个相同的手势";
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"同一个view上添加两个相同的手势";
            module.content = @"同一个view上添加两个相同的手势";
            module.classEntry = [TSBugTapSameViewController class];
            [sectionDataModel.values addObject:module];
        }
        [sectionDataModels addObject:sectionDataModel];
    }
    
    // Reload会闪烁
    {
        CQDMSectionDataModel *sectionDataModel = [[CQDMSectionDataModel alloc] init];
        sectionDataModel.theme = @"测试 Reload会闪烁";
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"Cell重用导致的图片错乱（方法1：已OK）";
            module.content = @"Cell重用导致的图片错乱";
            module.classEntry = [TSBugReuseTableViewController1 class];
            [sectionDataModel.values addObject:module];
        }
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"Cell重用导致的图片错乱（方法2:待修复）";
            module.content = @"Cell重用导致的图片错乱";
            module.classEntry = [TSBugReuseTableViewController2 class];
            [sectionDataModel.values addObject:module];
        }
        {
            CQDMModuleModel *module = [[CQDMModuleModel alloc] init];
            module.title = @"测试Reload时候图片的闪烁";
            module.content = @"测试Reload时候图片的闪烁";
            module.classEntry = [TSBugReloadCollectionViewController class];
            [sectionDataModel.values addObject:module];
        }
        [sectionDataModels addObject:sectionDataModel];
    }
    
    self.sectionDataModels = sectionDataModels;
}


#pragma mark - Touch
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
